<table border=0 cellpadding=0 cellspacing=0 width=100%>
<tr>
    <td><%= start_form_tag :action=>'create_category'%>
	<table width="98%" cellspacing="0" cellpadding="2" border="0" align="center">
	    <%= render :partial=>'form_category'%>
	    <tr>
		<td><%= submit_tag "Add"%></td>
	    </tr>
	</table>
	<%= end_form_tag %>
    </td>
</tr>
<tr>
    <td style="padding-top:10px"><table border=0 cellpadding=1 cellspacing=0 width=98% align=center>
	    <tr bgcolor="#E6E6E6" height="24">		
		<td class="gridTitle" align="left" width="5%">&nbsp;<b>#ID</b></td>
		<td class="gridTitle" align="left" width="20%">&nbsp;<b>Parent Category</b></td>
		<td class="gridTitle" align="left" width="20%">&nbsp;<b>Category</b></td>
		<td class="gridTitle" align="center" width="30%">&nbsp;<b>Description</b></td>	      
		<td class="gridTitle" align="center" width="5%">&nbsp;<b>Seq</b></td>	      
		<td class="gridTitle" align="center" width="20%">&nbsp;</td>
	    </tr>
	    <% for category in @categories -%>
	    <tr style="background:#F6F6F6" height="24">
		<td class="gridRow" align="left"><%= category.id%></td>
		<td class="gridRow" align="left"><%= category.parent.name if !category.parent_id.nil?%><%= "Top" if category.parent_id.nil?%></td>
		<td class="gridRow" align="left"><%= category.name %></td>	
		<td class="gridRow" align="center"><%= category.description %></td>	
		<td class="gridRow" align="center"><%= category.sequence %></td>
   		<td class="gridRow" align="center"><%= link_to('edit', :action=>'edit_category',:id=>category)%>&nbsp;<%= link_to 'Destroy', {:action => 'destroy_category', :id=> category},  { :confirm => "Are you sure?", :post => true } %></td>
	    </tr>		
	    <% end -%>
	</table>
    </td>
</tr>
</table>